package com.eascs.demand.button;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;

import org.springframework.stereotype.Service;

import com.eascs.demand.entity.MainApply;
import com.eascs.demand.service.TicketMainApplyService;
import com.eascs.site.view.button.Button;
import com.eascs.site.view.button.ButtonHelper;
@Service
public class TicketButtonAll {
	@Inject
	TicketMainApplyService ticketMainApplyService;
	
	public List<Button> buildButtons(String demandid) {
		List<Button> buttons = new ArrayList<>();
		MainApply mainApply = ticketMainApplyService.findMainApplyByExpandId(demandid);
		if ("NEW".equals(mainApply.getBillStatus())) {
				buttons.add(ButtonHelper.createAjaxButton("提交申请",
						"/demand/startup?demandid=" + demandid,"loanapplyCredit"));
		}
		return buttons;
	}
}
